<?php
/**
 * @Author: Ron Chen
 * @Date:   2017-04-23 16:06:19
 * @Last Modified by:   Ron Chen
 * @Last Modified time: 2017-06-11 22:32:26
 */

?>
<nav class="navbar navbar-default">
	<div class="container-fluid">
	    <div class="navbar-header">
	      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar" aria-expanded="false">
	        <span class="sr-only">Toggle navigation</span>
	        <span class="icon-bar"></span>
	        <span class="icon-bar"></span>
	        <span class="icon-bar"></span>
	      </button>
	      <a class="navbar-brand" href="#">趣寻网</a>
	    </div>
	    <div class="collapse navbar-collapse" id="bs-example-navbar">
		    <ul class="nav navbar-nav">
		        <li class="dropdown">
		        	<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">我的订单 <span class="caret"></span></a>
		        	<ul class="dropdown-menu">
			            <li class="active"><a href="/user/my-order?type=1">待付款<span class="sr-only">(current)</span></a></li>
			            <li><a href="/user/my-order?type=2">保障中</a></li>
			        </ul>
		        </li>
			    <li class="dropdown">
		          	<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">服务指南 <span class="caret"></span></a>
			        <ul class="dropdown-menu">
			            <li><a href="/site/service">理赔指引</a></li>
			            <!-- <li><a href="#">保单查询</a></li> -->
			        </ul>
		        </li>
		      </ul>
	    </div>
  </div>
</nav>
<div class="row" style="margin-top: 10px;">
	<!-- 中间部分 -->
	<div class="col-sm-12 col-md-8">
		<div class="panel panel-default">
		  	<div class="panel-body">
		    	<ol class="breadcrumb">
					<li><a href="/user/my-order">我的订单</a></li>
					<li class="active"><a href="/user/my-order">我的订单</a></li>
				</ol>
				
				<div class="btn-group btn-group-justified" role="group" aria-label="...">
				  	<div class="btn-group" role="group">
				  		<a href="/user/my-order?type=0" class="btn btn-default <?= 0==$type ? "btn-success" : "";?>">全部</a>
					</div>
				  	<div class="btn-group" role="group">
				    	<a href="/user/my-order?type=1" class="btn btn-default <?= 1==$type ? "btn-success" : "";?>">待付款</a>
				  	</div>
				  	<div class="btn-group" role="group">
						<a href="/user/my-order?type=2" class="btn btn-default <?= 2==$type ? "btn-success" : "";?>">保障中</a>
					</div>
				  	<div class="btn-group" role="group">
						<a href="/user/my-order?type=3" class="btn btn-default <?= 3==$type ? "btn-success" : "";?>">已失效</a>
					</div>
				</div>
				
				<?php if($order && count($order) > 0) { ?>
				<dl class="media-list" style="margin-top: 10px;">
					<?php foreach ($order as $item) { ?>
					<dd class="media" style="border-bottom: 1px solid #eee;">
						<div class="media-body">
							<h4 class="media-heading">产品名称: <?php echo $item["title"]; ?></h4>
							<p class="text-info" style="padding-left: 10px;"><b> 被保险人 ：</b> <?php echo $item["name"]; ?></p>
							<p class="text-info" style="padding-left: 10px;"><b> 投保金额 ：</b> <span class="text-danger">￥<?php echo $item["premium_total"] ;?>元</span></p>
							<div class="row">
								<div class="col-xs-6">
									<a href="/index/detail?id=<?php echo $item["plan_code"]; ?>" class="btn btn-link btn-block">再次购买</a>		
								</div>
								<div class="col-xs-6">
									<a href="/user/order-detail?id=<?php echo $item["id"];?>" class="btn btn-link btn-block">查看保单</a>		
								</div>
							</div>
						</div>
					</dd>
					<?php } ?>	
				</dl>
				<?php }else{ ?>
					<p> 暂无订单 </p>
				<?php } ?>
			</div>
		</div>
	</div>
</div>


<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>